<?php
// this is the standard template data
$templateData = array(
                'title' => $this->title,
                'resourceUri' => $this->resourceUri,
                'description' => $this->description,
                'descriptionHelper' => $this->descriptionHelper,
                'options'           => $this->options
        );
?>
<?php if ($content = trim($this->partial( 'lod2/content.phtml', $templateData))): ?>

<div class="maincontent">
    <div class="section">
        <h3><?php echo $this->title ?></h3>
        <div class="section-content">
            <?php echo $content; ?>
        </div>
    </div>
</div>

<?php endif; ?>

<div class="subcolumns">

<?php // WORKPACKAGES

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
PREFIX sysont: <http://ns.ontowiki.net/SysOnt/>
SELECT DISTINCT ?resourceUri
WHERE {
<'.$this->resourceUri.'> lod2:wp ?resourceUri.
?resourceUri a lod2:WorkPackage.
?resourceUri sysont:order ?order.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?order)
​';

if ($workpackages = $this->querylist($query, 'lod2/items/li.phtml')): ?>

<div class="c33l">
    <div class="subcl widget-deeplink">
        <h3>Workpackages</h3>
         <ul>
            <?php echo $workpackages ?>
         </ul>
    </div>
</div>

<?php endif; ?>

<?php // MILESTONES

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
PREFIX sysont: <http://ns.ontowiki.net/SysOnt/>
SELECT DISTINCT ?resourceUri
WHERE {
<'.$this->resourceUri.'> lod2:wp ?wp.
?resourceUri lod2:wp ?wp .
?resourceUri a lod2:Milestone.
?resourceUri lod2:deadline ?date.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?date)
​';

if ($tasks = $this->querylist($query, 'lod2/items/li.phtml')): ?>

<div class="c33l">
    <div class="subc widget-deeplink">
        <h3>Milestones</h3>
         <ul>
            <?php echo $tasks ?>
         </ul>
    </div>
</div>

<?php endif; ?>

<?php // PARTNERS

$query = '
PREFIX lod2: <http://lod2.eu/schema/>
PREFIX sysont: <http://ns.ontowiki.net/SysOnt/>
SELECT DISTINCT ?resourceUri
WHERE {
<'.$this->resourceUri.'> lod2:wp ?wp.
?wp lod2:partner ?resourceUri.
?resourceUri a lod2:Partner.
?resourceUri sysont:order ?order.
FILTER (!isBLANK(?resourceUri))
}
ORDER BY ASC(?order)
​';

if ($partners = $this->querylist($query, 'lod2/items/li.phtml')): ?>

<div class="c33l">
    <div class="subcr widget-deeplink">
        <h3>Partners</h3>
         <ul>
            <?php echo $partners ?>
         </ul>
    </div>
</div>

<?php endif; ?>

</div>